<%@page import="controller.Paginate"%>
<%@page import="controller.Utils"%>
<%@page import="com.mongodb.DBObject"%>
<%@page import="com.mongodb.DBCursor"%>
<%
String topic = (String) request.getAttribute("name");
int total = Integer.parseInt((String) request.getAttribute("total"));
int p = Integer.parseInt((String)request.getAttribute("page"));
int np = Integer.parseInt((String)request.getAttribute("np"));
DBCursor domain = (DBCursor) request.getAttribute("domain");
DBObject domains = (DBObject) request.getAttribute("wip");
DBObject ip = (DBObject) request.getAttribute("dbObject");

String title = "Lookup Ip "+topic;
String description = "Ip "+topic +" "+ Utils.ValidDomain()+" - search, ip lookup information on  "+Utils.ValidDomain();
String keywords = topic+",ip,ip address,lookup ip";
%>
<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>"/>
	<jsp:param name="description" value="<%=description %>"/>
	<jsp:param name="keywords" value="<%=keywords %>"/>
</jsp:include>
		<div class="body all">
			<div class="cate">
				<%@ include file='/element/menu_left.jsp'%>
				<jsp:include page="/element/new_site.jsp"></jsp:include>
				<jsp:include page="/element/random_site.jsp"></jsp:include>
			</div>
			<div class="content">
				<%@ include file='/adv/menu.jsp'%>
				
				<div class="content_left left">
					<h2 class="title left">Lookup Ip :</h2>
					<div class="add_this right">
						<!-- AddThis Button BEGIN -->
						<div class="addthis_toolbox addthis_default_style ">
						<a class="addthis_button_preferred_1"></a>
						<a class="addthis_button_preferred_2"></a>
						<a class="addthis_button_preferred_3"></a>
						<a class="addthis_button_preferred_4"></a>
						<a class="addthis_button_compact"></a>
						<a class="addthis_counter addthis_bubble_style"></a>
						</div>
						
						<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4d6f3cdb1d190d60"></script>
						<!-- AddThis Button END -->
					</div>
					<div class="sum_one right">
						<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
						<g:plusone size="small" count="true"></g:plusone>
					</div>
					<div class="clear"></div>
					
					<form action="/search-ip" class="search">
						<input type="text" name="name"/>
						<button>Lookup Ip</button>
						<br/>
						<b>Example Searches</b> : <a href="/ip/75.126.102.228">75.126.102.228</a> , <a href="/ip/67.228.81.180">67.228.81.180</a>
					</form>
		
					<br/>
					<h2 class="title">Ip : <%=topic %></h2>
					<ul class="detail_ip">
						<li>
							<div class="ip_left">ISP:</div>
							<div class="ip_right"><%=(ip.get("jsp")!=null&&!ip.get("jsp").toString().equals(""))?ip.get("jsp"):"-" %></div>
						</li>
						<li>
							<div class="ip_left">Organization:</div>
							<div class="ip_right"><%=(ip.get("organization")!=null&&!ip.get("organization").toString().equals(""))?ip.get("organization"):"-" %></div>
						</li>
						<li>
							<div class="ip_left">Proxy:</div>
							<div class="ip_right"><%=(ip.get("proxy")!=null&&!ip.get("proxy").toString().equals(""))?ip.get("proxy"):"-" %></div>
						</li>
						<li>
							<div class="ip_left">Type:</div>
							<div class="ip_right"><%=(ip.get("type")!=null&&!ip.get("type").toString().equals(""))?ip.get("type"):"-" %></div>
						</li>
						<li>
							<div class="ip_left">Assignment:</div>
							<div class="ip_right"><%=(ip.get("assignment")!=null&&!ip.get("assignment").toString().equals(""))?ip.get("assignment"):"-" %></div>
						</li>
						<li>
							<div class="ip_left">Country:</div>
							<div class="ip_right"><%=(ip.get("country")!=null&&!ip.get("country").toString().equals(""))?ip.get("country"):"-" %></div>
						</li>
						<li>
							<div class="ip_left">State/Region:</div>
							<div class="ip_right"><%=(ip.get("state")!=null&&!ip.get("state").toString().equals(""))?ip.get("state"):"-" %></div>
						</li>
						<li>
							<div class="ip_left">City:</div>
							<div class="ip_right"><%=(ip.get("city")!=null&&!ip.get("city").toString().equals(""))?ip.get("city"):"-" %></div>
						</li>
					</ul>
					<ul class="same_ip">
						
					</ul>
					<div class="clear"></div>
					<br/>
					<h2 class="title">Other sites hosted on <%=topic %></h2>
					<ul class="recent">
						<%=Utils.returnSame(domain) %>
					</ul>
					<div class="clear"></div>
					<br/>
					<h2 class="title">Whois ip <%=topic %></h2>
					<div class="whois_ip">
						<%=Utils.returnWhois(domains.get("wip").toString()) %>
					</div>
				</div>
				<div class="content_right right">
					<%@ include file='/adv/right.jsp'%>
				</div>
			</div>
			<div class="clear"></div>
		</div>
<%@ include file='/layout/footer.jsp'%>